#include<string>
#include<iostream>

string opers="+-*/%";

enum{
    DivZero=1,
    ModZero,
    UnKnown 
};

using namespace std;
class Task
{
public:
    Task(int data1,int data2,char oper)
    {
        data1_=data1;
        data2_=data2;
        oper_=oper;
    }
    void run()
    {
        switch(oper_)
        {
            case '+':
                result_=data1_+data2_;
                break;
            case '-':
                result_=data1_-data2_;
                break;
            case '*':
                result_=data1_*data2_;
                break;
            case '/':
                if(data2_==0)  exitcode_=DivZero;
                else result_=data1_/data2_;
                break;
            case '%':
                if(data2_==0)  exitcode_=ModZero;
                else result_=data1_%data2_;
                break;
            default:
                exitcode_=UnKnown;
        }
    }
    void operator()()
    {
        run();
    }
    string GetTask()
    {
        string s;
        s+=to_string(data1_);
        s+=oper_;
        s+=to_string(data2_);
        s+="=?";
        return s;
    }
    string GetResult()
    {
        string s;
        s+=to_string(data1_);
        s+=oper_;
        s+=to_string(data2_);
        s+="=";
        s+=to_string(result_);
        s+=", exitcode_ = ";
        s+=to_string(exitcode_);
        return s;
    }
private:
    int data1_;
    int data2_;
    char oper_;

    int result_;
    int exitcode_;
};
